<?php $host = sfConfig::get('app_host')?>
<form action="<?php echo url_for('league/index')?>" method="GET">
    <?php include_partial('partial/search', array());?>
</form>

<br clear="all">
<br clear="all">
<table width="100%" cellpadding="0" cellspacing="0">
  <thead>
    <tr>
      <th>#</th>
      <th>Logo</th>
      <th>Name</th>
      <th>Owner</th>
      <th>Founded</th>
      <th>Biography</th>
      <th></th>
    </tr>
  </thead>
  <tbody>
    <?php $i = 0; foreach ($pager->getResults() as $rs): ?>
    <tr <?php if($i%2 != 0) echo 'class="odd"'?>>
        <td><?php echo ++$i?></td>
        <td><?php if($rs->getLogo()) echo link_to(image_tag('/u/l/t300-'.$rs->getLogo(), array('style'=>'max-width:120px;max-height:100px;')), $host.'/u/l/'.$rs->getLogo(), array()) ?></td>
        <td>
            <a href="<?php echo url_for('league/edit?id='.$rs->getId())?>" class="action"><b><?php echo $rs->getName() ?></b></a><br>
        </td>
        <td><?php echo $rs->getOwner() ?></td>
        <td><?php echo $rs->getFounded() ?></td>
        <td><?php echo $rs->getBiography() ?></td>
        <td nowrap>
            <?php include_partial('partial/edit', array('module'=>'league', 'id'=>$rs->getId()));?>
        </td> 
    </tr>
    <?php endforeach; ?>
  </tbody>
</table>
<?php echo pager($pager, 'league/index?s='.$sf_params->get('s'))?>
